{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7e14618b-7567-4903-8ca7-b8b31d049f23",
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.optim as optim\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9f581ffa-b4b4-460f-b43b-b5ed26793994",
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train = torch.rand(20)\n",
    "k = 2\n",
    "b = 3\n",
    "y_train = k * x_train + b + torch.randn(20) * 0.02"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2a619a36-c0e3-4a65-b857-033efa4d2c5b",
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train = torch.unsqueeze(x_train, 1)\n",
    "y_train = torch.unsqueeze(y_train, 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1c90bba9-8637-4e13-8329-e655f247576d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1b5e4601850>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXaklEQVR4nO3df5BcZb3n8feHMcjIonNXRi5MGMPuslxZkR/bG7ibu0pYL0kQBSn/gEWtsqxKxStb1K26UbJ/aK37B27lH9a7aG6WolbLVYrCEFkWCFSxLCobZOYGCAixsoiSxKoEMGq8U5oMn/2jz2Az6Z4+PemZ7j7zeVV1Tfdznu7+PjWp75w853ueR7aJiIjqOqnXAURExMJKoo+IqLgk+oiIikuij4iouCT6iIiKe1uvA2jm9NNP94oVK3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zdHvOAr/RXctyVU2bctl+Q9BDwLPAGcIftpmV5g6Tk7/w/Af9d0m7q0xlftD3wyxdL+i5wOXC6pH3Al4Fl0N38liUQIiIqrt+nbiIi4gQl0UdEVFwSfURExSXRR0RUXBJ9RETFJdFHRFRcEn1ERMX9f6dUi+b1dM6aAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(torch.squeeze(x_train), torch.squeeze(y_train))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "a890515f-4f6f-476e-9469-40dce8e699be",
   "metadata": {},
   "outputs": [],
   "source": [
    "class Net(nn.Module):\n",
    "    def __init__(self):\n",
    "        super().__init__()\n",
    "        self.fc1 = nn.Linear(1, 1)\n",
    "    \n",
    "    def forward(self, x):\n",
    "        x = self.fc1(x)\n",
    "        return x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f701ca6c-76e8-455b-b181-43d866428f72",
   "metadata": {},
   "outputs": [],
   "source": [
    "net = Net()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "9d75fdbf-2b0a-4e61-8b52-741c3e1a2a30",
   "metadata": {},
   "outputs": [],
   "source": [
    "x_plot = torch.unsqueeze(torch.linspace(0, 1, 100), 1)\n",
    "y_plot = None\n",
    "with torch.no_grad():\n",
    "    y_plot = net(x_plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "4ee51f01-2134-401f-96f7-2070fc70e232",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1b5e472d3a0>]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAAOXRFWHRTb2Z0d2FyZQBN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bWXJM+ZFSQ+0Q3qvpNtsr0XEsUoqLF7ef9uvRcQbkt6wfVzSVZLGNajzjPlDku6OVgP3BdvflPQOSV+tpsTKFZ5fo2h9/JukH7N9ue0ZSe+T9GDfMQ9K+mD76um1kv4nIr5ddaEFGjpm25dJOirpA2M8u+o2dMwRcXlE7IuIfZI+J+k3xzikpXz/tv9O0i/Yrtu+UNLPSjpVcZ1FyjPml9U6g5DtN0u6QtKLlVZZrcLzq/IZdUSs2f5tSQ+pdcX4/oh4zvZvtF//uForAG6T9IKk/1Prf+SxlXPMfyzpByX9VXuGuRZjvPNYzjFPlDxjjohTtr8o6WlJTUn3RUTmMq9xkPPn/KeSPmn7GbXaAh+OiLHd/tT2ZyTdIGmv7Vck3SVpWiovv7iFHAASx52JAJA4ghoAEkdQA0DiCGoASBxBDQCJI6gBIHEENQAk7v8Bygx5prAvbwYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(torch.squeeze(x_train), torch.squeeze(y_train))\n",
    "plt.plot(torch.squeeze(x_plot), torch.squeeze(y_plot))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "12447b81-86ad-47d2-babc-f9cc0c998c72",
   "metadata": {},
   "outputs": [],
   "source": [
    "criterion = nn.MSELoss()\n",
    "optimizer = optim.Adam(net.parameters(), lr=0.01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "fa62ccd5-c474-46d8-b0f7-0c4ebd039723",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch: [10/500]; Loss: 10.227762222290039\n",
      "Epoch: [20/500]; Loss: 9.23530101776123\n",
      "Epoch: [30/500]; Loss: 8.307771682739258\n",
      "Epoch: [40/500]; Loss: 7.447634696960449\n",
      "Epoch: [50/500]; Loss: 6.654740810394287\n",
      "Epoch: [60/500]; Loss: 5.927243232727051\n",
      "Epoch: [70/500]; Loss: 5.262373447418213\n",
      "Epoch: [80/500]; Loss: 4.656917572021484\n",
      "Epoch: [90/500]; Loss: 4.107480525970459\n",
      "Epoch: [100/500]; Loss: 3.6106133460998535\n",
      "Epoch: [110/500]; Loss: 3.1628780364990234\n",
      "Epoch: [120/500]; Loss: 2.7608838081359863\n",
      "Epoch: [130/500]; Loss: 2.401301622390747\n",
      "Epoch: [140/500]; Loss: 2.0808911323547363\n",
      "Epoch: [150/500]; Loss: 1.7965056896209717\n",
      "Epoch: [160/500]; Loss: 1.5451122522354126\n",
      "Epoch: [170/500]; Loss: 1.3237978219985962\n",
      "Epoch: [180/500]; Loss: 1.1297800540924072\n",
      "Epoch: [190/500]; Loss: 0.9604222178459167\n",
      "Epoch: [200/500]; Loss: 0.8132331967353821\n",
      "Epoch: [210/500]; Loss: 0.685875415802002\n",
      "Epoch: [220/500]; Loss: 0.5761715173721313\n",
      "Epoch: [230/500]; Loss: 0.4821024537086487\n",
      "Epoch: [240/500]; Loss: 0.4018089771270752\n",
      "Epoch: [250/500]; Loss: 0.3335910439491272\n",
      "Epoch: [260/500]; Loss: 0.2759011387825012\n",
      "Epoch: [270/500]; Loss: 0.22734303772449493\n",
      "Epoch: [280/500]; Loss: 0.18666322529315948\n",
      "Epoch: [290/500]; Loss: 0.15274396538734436\n",
      "Epoch: [300/500]; Loss: 0.1245947927236557\n",
      "Epoch: [310/500]; Loss: 0.10134425014257431\n",
      "Epoch: [320/500]; Loss: 0.0822305828332901\n",
      "Epoch: [330/500]; Loss: 0.06659085303544998\n",
      "Epoch: [340/500]; Loss: 0.05385338142514229\n",
      "Epoch: [350/500]; Loss: 0.04352738335728645\n",
      "Epoch: [360/500]; Loss: 0.035194918513298035\n",
      "Epoch: [370/500]; Loss: 0.02850141003727913\n",
      "Epoch: [380/500]; Loss: 0.023148052394390106\n",
      "Epoch: [390/500]; Loss: 0.01888507790863514\n",
      "Epoch: [400/500]; Loss: 0.015504719689488411\n",
      "Epoch: [410/500]; Loss: 0.012834569439291954\n",
      "Epoch: [420/500]; Loss: 0.010733569040894508\n",
      "Epoch: [430/500]; Loss: 0.009086083620786667\n",
      "Epoch: [440/500]; Loss: 0.007797992322593927\n",
      "Epoch: [450/500]; Loss: 0.006793360225856304\n",
      "Epoch: [460/500]; Loss: 0.006011091638356447\n",
      "Epoch: [470/500]; Loss: 0.005402485840022564\n",
      "Epoch: [480/500]; Loss: 0.00492874626070261\n",
      "Epoch: [490/500]; Loss: 0.004559251479804516\n",
      "Epoch: [500/500]; Loss: 0.004269949626177549\n"
     ]
    }
   ],
   "source": [
    "for i in range(0, 500):\n",
    "    y_hat = net(x_train)\n",
    "    loss = criterion(y_hat, y_train)\n",
    "    \n",
    "    optimizer.zero_grad()\n",
    "    loss.backward()\n",
    "    optimizer.step()\n",
    "    \n",
    "    if i % 10 == 9:\n",
    "        print(\"Epoch: [%s/%s]; Loss: %s\" % (i+1, 500, loss.item()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "bccede7c-6869-48c0-a66d-026cabea56f9",
   "metadata": {},
   "outputs": [],
   "source": [
    "x_plot = torch.unsqueeze(torch.linspace(0, 1, 100), 1)\n",
    "y_plot = None\n",
    "with torch.no_grad():\n",
    "    y_plot = net(x_plot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "dc883ae5-593a-493b-ab62-aea61f733cc8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1b5e47b6e80>]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEw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9/nlnAvJBxANbAB6AXHASmBQnTGTgLcAA8YAXwW77gDM+VSgXc3HE5vDnGuN+wBYDFwe7LoD8HVOAlYDaTXPOwW77gDM+S7g8ZqPOwJ7gLhg134ccz4DGA5kN7Dd5/kVynvoo4Bc59xG51w58BpwcZ0xFwOvuGpfAklm1jXQhfpQo3N2zn3unPu+5umXQGqAa/Q1b77OAL8C5gEFgSzOT7yZ81VAhnPuOwDnXLjP25s5O6CNmRnQmupArwxsmb7jnPuE6jk0xOf5FcqB3g3Iq/V8a81rTR0TTpo6nxuo/g0fzhqds5l1AyYDswNYlz9583XuB7Qzs4/MbLmZXRuw6vzDmzk/AwwEtgFZwK3OOU9gygsKn+dXKN8k2up5re4aS2/GhBOv52NmZ1Md6Kf5tSL/82bOvwemO+eqqnfewp43c44BRgDnAgnAF2b2pXNunb+L8xNv5jwe+BY4B+gNvGtmnzrn9vq5tmDxeX6FcqBvBbrXep5K9W/upo4JJ17Nx8yGAi8AE51zuwNUm794M+d04LWaME8GJplZpXNuQUAq9D1vv7cLnXMlQImZfQIMA8I10L2Z8xTgMVd9gDnXzDYBA4B/B6bEgPN5foXyIZevgb5m1tPM4oArgYV1xiwErq05WzwGKHbObQ90oT7U6JzNLA3IAH4SxntrtTU6Z+dcT+dcD+dcD2Au8D9hHObg3ff2G8DpZhZjZi2B0cCaANfpS97M+Tuq/0eCmXUG+gMbA1plYPk8v0J2D905V2lmvwSWUH2G/EXn3Cozu6lm+2yqVzxMAnKBA1T/hg9bXs7510AH4LmaPdZKF8ad6rycc0TxZs7OuTVm9jaQCXiAF5xz9S5/Cwdefp0fAv7PzLKoPhwx3TkXtm11zezvwFlAspltBe4DYsF/+aVL/0VEIkQoH3IREZEmUKCLiEQIBbqISIRQoIuIRAgFuohIhFCgi4hECAW6iEiE+P9GQsRWxLNldQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(torch.squeeze(x_train), torch.squeeze(y_train))\n",
    "plt.plot(torch.squeeze(x_plot), torch.squeeze(y_plot))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "02b5d898-8283-482e-8ed6-ee0eef983899",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
